package io.github.cchenxi.crpc.core.api;

import java.util.List;

import org.springframework.util.CollectionUtils;

/**
 * 负载均衡
 * Date: 2024-03-17
 *
 * @author chenxi
 */
public interface Loadbalancer<T> {

    T choose(List<T> providers);

    Loadbalancer Default = providers -> CollectionUtils.isEmpty(providers) ? null : providers.get(0);
}
